/**
 * Cone extends Circle3D, it includes methods to calculate surface area
 * and volume.
 * A method to calculate the slant of the cone is also included.
 */
public class Cone extends Circle3D {
    //instance variables
    private double height;
    //constructor methods
    public Cone(double r, double h) {
        super.setRadius(r);
        height = h;
    }
    public Cone() {
        super.setRadius(0.0);
        height = 0.0;
    }
    //getter
    public double getHeight() {
        return height;
    }
    //setter
    public void setHeight(double h) {
        height = h;
    }
    //mutator methods
    public double calcSlant() {
        return Math.sqrt((super.getRadius() * super.getRadius()) + (height * height));
    }
    public double calcSurfaceArea() {
        return super.calcBase() + Math.PI * super.getRadius() * this.calcSlant();
    }
    public double calcVolume() {
        return (1.0/3.0) * super.calcBase() * height;
    }
}